#!/bin/sh
psql --pset "format=unaligned" --pset "fieldsep= " -t -U netdisco -c "select name,dns,snmp_comm,ip from device where name ilike '%sw%'" netdisco | while read a
do
	set $a
	dns=`echo $1 | sed -e 's/.meeting.ietf.org//'`
	./add-one-switch $dns $4
done
